﻿// -----------------------------------------------------------------------
// <copyright file="TaskReadMemory.cs" company="DarkBone">
// DarkBone
// </copyright>
// -----------------------------------------------------------------------

namespace DarkBone.Engine.Tasks
{
   using System;

   /// <summary>
   /// Task to Read Memory
   /// </summary>
   [Serializable]
   public class TaskReadMemory : Task
   {
      /// <summary>
      /// Address to read
      /// </summary>
      private readonly IntPtr addressToRead;

      /// <summary>
      /// bytes read
      /// </summary>
      private byte[] bytes;

      /// <summary>
      /// Initializes a new instance of the <see cref="TaskReadMemory"/> class. 
      /// </summary>
      /// <param name="addressToRead">
      /// Address to read
      /// </param>
      /// <param name="bytesToRead">
      /// How many bytes memReader should read
      /// </param>
      public TaskReadMemory(IntPtr addressToRead, int bytesToRead)
      {
         this.Id = ID.ReadMemory;
         this.addressToRead = addressToRead;
         this.bytes = new byte[bytesToRead];
      }

      /// <summary>
      /// Gets address to read
      /// </summary>
      public IntPtr AddressToRead
      {
         get
         {
            return this.addressToRead;
         }
      }      

      /// <summary>
      /// Gets or sets bytes
      /// </summary>
      public byte[] Bytes
      {
         get
         {
            return this.bytes;
         }

         set
         {
            this.bytes = value;
         }
      }      
   }
}
